package net.pulseproject.router.modules;

import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;

import javax.sound.midi.ShortMessage;

import net.pulseproject.commons.midi.Receivable;
import net.pulseproject.commons.midi.Transmitable;

public class ReceivableCollector implements Receivable {
	
	private final Collection<ShortMessage> messages = new LinkedList<ShortMessage>();
	
	@Override
	public final void receive(final ShortMessage message, final Transmitable transmitable) {
		this.messages.add(message);
	}
	
	public final Collection<ShortMessage> getMessages() {
		return Collections.unmodifiableCollection(this.messages);
	}

}
